package com.wms.base.mapper;

import com.wms.base.domain.BaseWarehouse;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 仓库Mapper接口
 */
public interface BaseWarehouseMapper {
    /**
     * 查询仓库
     *
     * @param warehouseId 仓库主键
     * @return 仓库
     */
    BaseWarehouse selectBaseWarehouseByWarehouseId(Long warehouseId);

    /**
     * 查询仓库
     *
     * @param warehouseCode
     * @return 仓库
     */
    String selectBaseWarehouseNameByWarehouseCode(String warehouseCode);

    @Select(("select warehouse_code from base_warehouse where warehouse_name=#{warehouseName}"))
    String selectBaseWarehouseNameByWarehouseName(String warehouseName);

    /**
     * 查询仓库列表
     *
     * @param baseWarehouse 仓库
     * @return 仓库集合
     */
    List<BaseWarehouse> selectBaseWarehouseList(BaseWarehouse baseWarehouse);

    /**
     * 新增仓库
     *
     * @param baseWarehouse 仓库
     * @return 结果
     */
    int insertBaseWarehouse(BaseWarehouse baseWarehouse);

    /**
     * 修改仓库
     *
     * @param baseWarehouse 仓库
     * @return 结果
     */
    int updateBaseWarehouse(BaseWarehouse baseWarehouse);

    /**
     * 删除仓库
     *
     * @param warehouseId 仓库主键
     * @return 结果
     */
    int deleteBaseWarehouseByWarehouseId(Long warehouseId);

    /**
     * 批量删除仓库
     *
     * @param warehouseIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteBaseWarehouseByWarehouseIds(Long[] warehouseIds);
}
